#!/bin/sh
# 店铺索引：搜索建议suggest，分词搜索content(name)
curl -XDELETE 'http://localhost:9200/shop'
curl -XPUT 'http://localhost:9200/shop'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/shop/_mapping?pretty' -d '{
        "properties" : {
                "id" : { "type" : "long" },
                "name" : { "type" : "keyword" , "copy_to": [ "content", "suggest" ] },
                "avatar" : { "type" : "keyword", "index": false },
                "logo" : { "type" : "keyword", "index": false },
                "areaId" : { "type" : "keyword" },
                "content" : { "type" : "text", "analyzer": "ik_max_word" },
                "suggest" : { "type" : "completion", "analyzer": "ik_max_word" }
        }
}'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/shop/_settings' -d '{
        "index" : {  "max_result_window" : 1000000 }
}'
